home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / tex / lametex_.z / lametex_ / lametex / page / page_title.ps < prev    next >
Encoding:
Text File  |  1992-09-02  |  6.7 KB  |  222 lines

  1. %! page_title.ps   - A fancy titlepage for a document
  2. %% This is a LameTeX Page Description File written in PostScript.
  3. %% Postscript Code by Jon Monsarrat Copyright 1992
  4. %% permission given for anything except selling this or deleting the header.
  5. %% This is a page template for the LameTeX formatter
  6. %% A normal page for LameTeX output to look like LaTeX output
  7.  
  8. %% REQUIRED DEFINITIONS START HERE %%
  9.  
  10. % Makes a path that desribes the page and leaves a setflat value on the stack.
  11. /PageShape
  12. {
  13.   0 0 moveto 8.5 in 0 lineto 8.5 in 11 in lineto 0 11 in lineto closepath
  14.   currentflat 8 mul
  15. } bind def
  16.  
  17. /StartPage
  18. {
  19.    %%%%%%%%%%%%%%%% string Weird-Stuff %%%%%%%%%%%%%%%%%%%%%%%%%%
  20.    % Weird-Stuff puts some fancy border stuff in around a given string
  21.    /Weird-Stuff
  22.    {
  23.       save
  24.          %%%%%%%%%%%%%%%% num num block %%%%%%%%%%%
  25.          % width and  X position
  26.          /Block
  27.          {
  28.             0 moveto dup 0 rlineto
  29.             .35 in .7 in rlineto -1 mul 0 rlineto 
  30.             closepath 1 setgray fill 0 setgray
  31.          } bind def
  32.          %%%%%% end of Block %%%%%%%%%%%%%%%%
  33.    
  34.          0.6 setgray
  35.          exch /name exch def
  36.          90 rotate 0 -1.1 in translate
  37.          /bit {.02 in} def
  38.          gsave
  39.          
  40.          2 in 0 translate
  41.          .7 in dup scale
  42.          1 3 in div setlinewidth
  43.          
  44.          /Thick 1 8 div def
  45.          /Tall 1 def
  46.          /HalfThick Thick .5 mul def
  47.          
  48.          newpath
  49.              HalfThick Thick moveto
  50.              Thick  0 lineto
  51.              1 Thick sub  0 lineto
  52.              1 HalfThick sub  Thick lineto
  53.              .5 HalfThick add  Tall Thick sub lineto
  54.          
  55.              1 Thick sub  0 moveto
  56.              .5 HalfThick add  Tall 3 Thick mul sub lineto
  57.              Thick 3 mul  Thick 2 mul lineto
  58.          
  59.              1 Thick 2.5 mul sub  Thick moveto
  60.              .5  Tall Thick 4 mul sub lineto
  61.          stroke
  62.          
  63.          newpath
  64.              HalfThick Thick moveto
  65.              1 Thick 2.5 mul sub  Thick lineto
  66.              HalfThick neg  Thick rlineto
  67.              Thick Thick add  Thick Thick add lineto
  68.              .5 HalfThick add  Tall Thick sub lineto
  69.              Thick neg  0 rlineto
  70.              closepath
  71.          fill
  72.          grestore
  73.          /Times-BoldItalic findfont 90 scalefont setfont
  74.          gsave 2.65 in 0 moveto 1 .5 scale
  75.          -.07 in 0 name ashow grestore
  76.          gsave 2.65 in .625 in moveto 1 -.22 scale
  77.          -.07 in 0 name ashow grestore
  78.          newpath .3 in 0 moveto 1.9 in 0 lineto
  79.          2.25 in .64 in lineto .3 in .64 in lineto
  80.          .5 in .32 in lineto closepath fill
  81.          6.4 in 0 moveto 8.9 in 0 lineto 8.8 in -.2 in lineto
  82.          9.5 in .32 in lineto 8.8 in .84 in lineto
  83.          8.9 in .64 in lineto 6.75 in .64 in lineto closepath fill
  84.          .05 in .7 in Block
  85.          .08 in 1.1 in Block
  86.          .11 in 1.5 in Block
  87.          .1 in 6.8 in Block
  88.          .15 in 7.3 in Block
  89.          .2 in 7.7 in Block
  90.          .2 in 8 in Block
  91.          .1 in 8.25 in Block
  92.       restore
  93.    } bind def
  94.    
  95.    %%%%%%%%%%%%% num num   circle  -   %%%%%%%%%%%%%%%%%%%%%%%%
  96.    % circle fills & strokes a small white circle around current point
  97.    /circle { currentpoint .1 in 0 rmoveto .1 in 0 360 arc
  98.              1 setgray fill } def
  99.    
  100.    /StringBuffer 10 string def
  101.    
  102.    %%%%%%%%%%%%%%%% string Shade - %%%%%%%%%%%%%%%%%%%%%%%%
  103.    % Shade prints a shaded character at the current position
  104.    % .8 top .1 bot gray
  105.    /Shade
  106.    {
  107.      currentpoint /aty exch def /atx exch def
  108.      gsave
  109.      dup true charpath clip (Mg) true charpath pathbbox
  110.      exch 4 -1 roll sub /wid exch def exch sub /hit exch def
  111.      /pl aty hit .3 mul sub def  /ph aty hit add .1 in sub def
  112.      pl .1 in ph
  113.      {
  114.        dup pl sub ph pl sub div .7 mul .1 add setgray
  115.        atx exch moveto wid 0 rlineto 0 hit rlineto
  116.        wid -1 mul 0 rlineto closepath fill
  117.      } for
  118.      grestore
  119.      dup 0 setgray true charpath stroke
  120.      atx aty moveto stringwidth pop 0 rmoveto
  121.    } bind def
  122.    
  123.    %%%%%%%%%%%%%%%% string Title - %%%%%%%%%%%%%%%%%%%%%%%%
  124.    % Title prints a string in the title position of the page,
  125.    % and shoots it full of holes!
  126.    /Title
  127.    {
  128.      save
  129.      exch /str exch def /border .2 in def  /hit 40 def
  130.      /NewCenturySchlbk-Bold findfont hit 1.5 mul scalefont setfont
  131.      str stringwidth pop /lg exch def
  132.      newpath 8.5 in lg sub 2 div 9.7 in moveto
  133.      gsave
  134.      currentpoint border sub exch border sub exch moveto
  135.      lg border 2 mul add 0 rlineto 0 hit border 2 mul add rlineto
  136.      lg -1 mul border 2 mul sub 0 rlineto closepath
  137.      gsave .8 setgray fill grestore 2 setlinewidth 0 setgray stroke
  138.      .5 setlinewidth
  139.      grestore
  140.      str length 1 sub 0 1 3 -1 roll
  141.      { rand pop
  142.        str exch 1 getinterval Shade
  143.      } for
  144.      1 1 30
  145.      {
  146.       pop rand BIG div 2 div
  147.              lg border 4 mul add mul 8.5 in lg sub 2 div add border sub
  148.       rand BIG div 2 div
  149.              hit border 4 mul add mul 10.1 in add border sub moveto
  150.       circle
  151.      } for
  152.      1 setlinewidth 0 setgray
  153.      restore
  154.    } bind def
  155.    
  156.    /Web
  157.    {
  158.        newpath
  159.        0 0 moveto
  160.        1 1 8 { pop 0.5 in 0 -3 in -3 in -2 in 0.5 in rcurveto 45 rotate } for
  161.    } bind def
  162.    
  163.    %%%%%% xlow ylow width height grain ShadeBox - %%%%%%%%%%%%%%%%%%
  164.    % shades in a box with increasingly darker horizontal rectangles.
  165.    /ShadeBox
  166.    {
  167.      newpath
  168.      6 dict begin
  169.      /grain exch def
  170.      /height exch def
  171.      /width exch def
  172.      /ylow exch def
  173.      /xlow exch def
  174.      newpath
  175.      ylow grain ylow height add grain sub
  176.      {
  177.        dup ylow sub height div .9 mul .1 add setgray  % How dark to stop?
  178.        xlow exch moveto width 0 rlineto
  179.        0 grain rlineto width neg 0 rlineto 
  180.        closepath fill
  181.      } for
  182.      end
  183.    } bind def
  184.    
  185.      1.5 in 1 in 6.5 in 5 in .05 in ShadeBox
  186.      
  187.      8 in 4 in translate
  188.      0 setgray Web fill
  189.      .2 in .2 in translate
  190.      .5 setgray 10 setlinewidth Web fill
  191.      .8 setgray 3 setlinewidth Web stroke
  192.      grestoreall  % Don't want all this to have an effect on text printing
  193. } bind def
  194.  
  195. /EndPage
  196. {
  197.    /pagenumber pagenumber 1 add def   % Don't print a page number on titlepage
  198.    showpage   % A new page here really does mean start a new page.
  199. } bind def
  200.  
  201. %% INITIALIZATION TO DO WHEN FILE IS LOADED %%
  202.  
  203. /InitPage
  204. {
  205.   /evenodd true def   % if true use even-odd rule; false means winding rule
  206.   /fillout false def  % true means fill outside shape. false is inside.
  207.  
  208.   % Page Defaults
  209.   /in { 72 mul } def
  210.   /BM 0 in def    % Absolute Bottom Margin for page
  211.   /TM 11 in def   % Absolute Top Margin for page
  212.   /LM 0 in def    % Absolute Left Margin for page
  213.   /RM 8.5 in def  % Absolute Right Margin for page
  214.   
  215.   userdict /pagenumber known not
  216.   { /pagenumber 1 def } if    % Initialize pagenumber if not done already
  217.  
  218.   /BIG 1073741824 def
  219. } bind def
  220.  
  221. InitPage        % Just loading this file initializes the page.
  222.